package com.example.mybatisannotation.controller;

import com.example.mybatisannotation.entity.Student;
import com.example.mybatisannotation.service.StuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/stu")
public class StuController {
    @Autowired
    StuService stuService;
    @RequestMapping("/stulist")
    public List<Student> getAllstus() {
        return stuService.getAllStudents();
    }
}
